/**
 * @description 用于验证表单是否为空的函数
 * @param select {string} 要验证表单的选择器
 * @ return {boolean} 是否为空
 */

var utils = {};
  utils.validateEmpty = function (select) {
  let ele = document.querySelector(select);
  let val = ele.value.trim();
  return val.length === 0;
};

// 获取url后面的id
utils.parseUrlParameter = function (){
  // id = 1&name=12&age=12&gender=男
  let arr = location.search.substring(1).split('&');
  // arr = ['id=4','name=123'];
  let obj = {};
  arr.forEach(e => {
    let temp = e.split('=');
    // obj['id'] = 4
    obj[temp[0]] = temp[1];
  });
  return obj;
}

